//==================================
//Copyright Mahongwei，raymhw@sohu.com
//Function:	dpram,Native interface
//Version     v0.1		2018.11.29		created
//=
//==================================

module dpram1w1r #(
	parameter	DW = 9,
	parameter AW = 10
	)
	(
		input		       clka ,
		input		       wea	,
		input[AW-1:0]		addra,
		input[DW-1:0]		dina,
		input				clkb,
		input				enb	,
		input  [AW-1:0]		addrb,
		output reg[DW-1:0]	doutb
		);
		
//(* ram_style = "block" *) reg [DW-1:0] mem[(2**AW)-1:0];
		reg [DW-1:0] mem[(2**AW)-1:0];
		
		///write ram a
		always @(posedge clka) begin
    		mem[addra] <= (wea) ? dina : mem[addra];
        end
    ///read ram b
    always @(posedge clkb) begin
    		doutb	<= (enb) ?  mem[addrb] : doutb ;
    end
    
 endmodule